import Vue from 'vue'
// import Router from 'vue-router'
import VueRouter from 'vue-router'

// Vue.use(Router)
Vue.use(VueRouter)

// export default new Router({
//   routes: [
//     {
//       path: '/',
//       name: 'HelloWorld',
//       component: HelloWorld
//     },
//     {
//       path: '/UserList',
//       name: 'UserList',
//       component: UserList
//     }
//   ]
// })

export default new VueRouter({
  routes: [{
      name: 'login',
      path: '/login',
      component: () => import('@/view/user/login.vue')
    },
    {
      name: 'main',
      path: '/',
      component: () => import('@/view/main.vue'),
      children: [{
          name: 'home',
          path: '',
          component: () => import('@/view/home.vue'),
        },
        {
          name: 'userlist',
          path: '/userlist',
          component: () => import('@/view/user/userlist.vue'),
        }
      ]
    }
  ]
})
